
package com.probiz.estore.eai.unit;

import java.util.List;

import javax.xml.bind.JAXBElement;

import com.probiz.estore.eai.common.GenericMarshaller;
import com.probiz.estore.eai.exception.EaiException;
import com.probiz.estore.eai.unit.generated.ObjectFactory;
import com.probiz.estore.eai.unit.generated.Unit;
import com.probiz.estore.eai.unit.generated.UnitSet;


public class UnitMarshaller extends GenericMarshaller<UnitSet> {
	@Override
	public JAXBElement<UnitSet> populateEntitySetElement()
			throws EaiException {
		ObjectFactory factory = new ObjectFactory();

		UnitSet unitSet = factory.createUnitSet();
		unitSet.setRoottag("unit");

		List<Unit> unitList = unitSet.getUnit();
		
		Unit unit = factory.createUnit();
		unit.setCode("bottle");
		unit.setName("瓶");
		unitList.add(unit);
		
		unit = factory.createUnit();
		unit.setCode("chepi");
		unit.setName("车皮");
		unitList.add(unit);


		JAXBElement<UnitSet> unitDataElement=factory.createUfinterface(unitSet);
	
		return unitDataElement;
	}
}
